package com.weiyuwqj.server.service.account.module.action.sys;

import com.weiyuwqj.server.service.account.module.action.AbstractDealAction;
import com.weiyuwqj.api.constant.DealType;
import com.weiyuwqj.api.util.IpUtils;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by huzj on 2016/12/20.
 */
public class TransferServerDealAction extends AbstractDealAction {

    public TransferServerDealAction() {
        log.setOperType(DealType.TRANSFER_SERVER);
    }

    @Override
    public void dealAccount() {
        log.setUsable(log.getOperMoney());
        if (log.getOperMoney().compareTo(BigDecimal.ZERO) > 0) {
            log.setBudgetType(1);
        } else {
            log.setBudgetType(2);
        }
        log.setAddtime(new Date());
        log.setCash(log.getOperMoney());
        log.setAddip(IpUtils.get());
    }
}